<?php

	class Pacman_Bootstrap extends Zend_Application_Module_Bootstrap 
	{

		private $view;

		protected function _initBootstrap () 
		{
			$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
			$viewRenderer->initView();
			$this->view = $viewRenderer->view;
		}

		/**
		* inicializa o layout do modulo
		* @return [type] [description]
		*/
		protected function _initLayout()
		{	
			$layoutPlugin = new System_Plugins_LayoutSwitcher();
			$layoutPlugin->registerModuleLayout(
								'pacman',
								APPLICATION_PATH.'/modules/pacman/layouts/scripts',
								'layout'
								);
			$frontController = Zend_Controller_Front::getInstance();
			$frontController->registerPlugin($layoutPlugin);
		}

	
		protected function _initDocType() 
		{
			$this->view->doctype('XHTML1_STRICT');
		}

		protected function _initTitle() 
		{
			$this->view->headTitle('Pacman Pandora');
		}


		protected function _initMeta() 
		{
			$this->view->headMeta()->appendName('content-type', 'text/html; charset=utf-8');
			$this->view->headMeta()->appendName('content-language', 'pt, pt-br');
			$this->view->headMeta()->appendName('cache-control', 'public');
			$this->view->headMeta()->appendName('imagetoolbar', 'no');
			$this->view->headMeta()->appendName('content-script-type', 'text/javascript');
			$this->view->headMeta()->appendName('content-style-type', 'text/css');
			$this->view->headMeta()->appendName('DC.title', 'Estat&iaccute;stica do Cotidiano');
			$this->view->headMeta()->appendName('DC.creator', 'Pandora Desenvolvimento');
			$this->view->headMeta()->appendName('DC.creator.address', 'desenvolvimento.pda@gmail.com');
			$this->view->headMeta()->appendName('DC.subject', '');
			$this->view->headMeta()->appendName('DC.description', '');
			$this->view->headMeta()->appendName('author', 'Pandora Desenvolvimento');
			$this->view->headMeta()->appendName('language', 'pt-br');
			$this->view->headMeta()->appendName('classification', 'Internet');
			$this->view->headMeta()->appendName('robots', 'index, follow');
			$this->view->headMeta()->appendName('rating', 'general');
			$this->view->headMeta()->appendName('copyright', 'Restricted');
			$this->view->headMeta()->appendName('doc-rights', 'Public');
			$this->view->headMeta()->appendName('geo.region', 'RS');
			$this->view->headMeta()->appendName('geo.placename', 'Carlos Barbosa');
			$this->view->headMeta()->appendName('distribution', 'Global');
			$this->view->headMeta()->appendName('revisit-after', '1 day');
			$this->view->headMeta()->appendName('keywords', '');
		}

		protected function _initVariables()
		{
			date_default_timezone_set('America/Sao_Paulo');
		}

		protected function _initFavIcon()
		{
			$this->view->headLink()->headLink(array('rel' => 'favicon', 'href' => $this->view->baseUrl(). '/pacman/img/favicon.ico'));
		}

		protected function _initJavaScript() 
		{
			/**
			 * inclusão do jquery
			 */
			$this->view->headScript()->appendFile($this->view->baseUrl().'/pacman/js/jquery-1.5.2.min.js');

			/**
			 * arquivos default do template
			 */
			$this->view->headScript()->appendFile($this->view->baseUrl().'/pacman/js/hideshow.js');
			$this->view->headScript()->appendFile($this->view->baseUrl().'/pacman/js/jquery.tablesorter.min.js');
			$this->view->headScript()->appendFile($this->view->baseUrl().'/pacman/js/jquery.equalHeight.js');

			/**
			 * arquivo main
			 */
			$this->view->headScript()->appendFile($this->view->baseUrl().'/pacman/js/main.js');
		}

		protected function _initCss() 
		{
			/**
			 * css's dos templates
			 */
			///$this->view->headLink()->appendStylesheet($this->view->baseUrl().'/pacman/css/ie.css');
			$this->view->headLink()->appendStylesheet($this->view->baseUrl().'/pacman/css/layout.css');
			
		}

		protected function _initSessions()
		{
			Zend_Session::Start();        
			//        SCOPE OF USER:
			//        $user = new Zend_Session_Namespace('user');
			//        $user->name="anonymous";
			//        $user->password="";

			// $this->projectInfo =  new Zend_Session_Namespace('projectInfo');
			// $this->projectInfo->id = $postData['projectId'];

		}

		


	}
